package com.qingcloud.adminbackend.enums;

/**
 * 数据源类型枚举
 *
 * @author wangjinnan
 */
public enum DataSourceTypeEnum {

    DATABASE(1, "数据库"),
    HIVE(2, "HIVE表"),
    KAFKA(3, "KAFKA");

    public Integer code;

    public String title;

    DataSourceTypeEnum(Integer code, String title) {
        this.code = code;
        this.title = title;
    }

    public static String getTitleByCode(Integer code) {
        DataSourceTypeEnum[] uss = values();
        for (DataSourceTypeEnum us : uss) {
            if (us.code.equals(code)) {
                return us.title;
            }
        }
        return "";
    }
}
